package com.tansun.easycare.core.config;

import java.io.IOException;
import java.util.Properties;

import org.springframework.core.io.support.PropertiesLoaderUtils;

public class Global {
	
	private  static Properties properties = null ; 

	private  static  Global  instance;
	
	public  static Global  getInstance() {
		  if (instance == null) {
			  instance = new  Global();
		  }
		  return  instance;
	}
	public  static String getConfig(String key) {
	      if (properties == null) {
	    	  try {
				properties = PropertiesLoaderUtils.loadAllProperties("easycare.properties");
			  } catch (IOException e) {
				  e.printStackTrace();
			  }
	      }
	      return  properties.getProperty(key);
	}
}
